"""
@Time ： 2021/12/7 18:06
@Auth ： ChenZhangKun
"""
import threading
import time

num = 100


def demo1(temp):
    temp.append(33)
    global num
    num += 1
    print(num)


def demo2(temp):
    temp.append(44)
    print(num)


g_nums = [11, 22]

if __name__ == '__main__':
    # target指定执行的函数，args指定调用函数的时候，传递什么数据过去,参数类型是元祖
    t1 = threading.Thread(target=demo1, args=(g_nums,))
    t2 = threading.Thread(target=demo2, args=(g_nums,))
    t2.start()
    time.sleep(1)
    t1.start()
    print(g_nums)
